package MyList;

public class Test {
    public static void main(String[] args) {
        SingleLinkedList list = new SingleLinkedList();
        System.out.println("头插元素->");
        list.addFirst(11);
        list.addFirst(22);
        list.display();

        System.out.println("尾插元素->");
        list.addLast(33);
        list.addLast(44);
        list.display();

        System.out.println("在任意位置插入元素->");
        list.addIndex(0,99);
        list.addIndex(3,99);
        list.addIndex(6,99);
        list.display();
        System.out.println("删除11");
        list.remove(11);
        list.display();
        System.out.println("删除全部的99");
        list.removeAllKey(99);
        list.display();
    }
}
